package com.fanjia.es_demo.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author fanjia
 * @className ESConfig
 * @description TODO
 * @date 2021/4/13 20:17
 */
@Configuration
public class ESConfig {


    @Bean
    public RestHighLevelClient restHighLevelClient(){
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(
                        /* new HttpHost("", 9200, "http"),*/
                        new HttpHost("192.168.130.112", 9200, "http")));
        return client;
    }




}
